<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="shortcut icon" href="imagens/date_and_time-icon.gif" type="image/icon" />
<noscript>
	<meta http-equiv="Refresh"
		content="1;
          url=erroJavaScript.html">
</noscript>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="js/jquery-1.7.2.min.js"></script>
<script src="js/jquery-ui-1.8.21.custom.min.js"></script>
<script src="js/ajaxSetup.js"></script>
<link rel="stylesheet" href="css/jquery-ui-1.8.21.custom.css" />
<link rel="stylesheet" href="css/css.css" />
<title>CG - Controle de Gráfica</title>
<script>
	$(function() {
		
		if ($.browser.webkit == true || $.browser.mozilla == true) {
		
			$("#btnLogar").button();
			$("#login").focus();
			
			
			function erro( t , d ) {
				d.hide();
				d.html( t ).addClass( "ui-state-highlight " );
				d.fadeIn(1000);
				setTimeout(function() {
					d.removeClass( "ui-state-highlight ", 500 );
				}, 3500 );
			};
	
			$("#btnLogar").click(function() {
	
				var form = $("#formLogin").serialize();
	
				$.ajax({
					url : "loginServlet",
					data : form,
					beforeSend : function() {
						$("#msn").html("Logando...");
					},
					success : function(html) {
						if (html == "") {
							window.location.href = "gerenciadorOS.jsp";
						} else {
							erro(html, $("#msn"));
						}
					},
					error : function() {
						$("#msn").html("");
					}
	
				});
	
				return false;
			});
		}else{
			window.location.href="browser.html";
		}
	});
</script>
</head>
<body style="background: threedlightshadow;">
	<div id="divLogin" class="login" align="center">
		<fieldset class="ui-corner-all"
			style="width: 215px; box-shadow: 2px 5px 12px #555; border: 0px;">
			<div style="font-size: 16px; font-weight: bold; width: 160px; padding-bottom: 5px; padding-top: 5px; position: relative; left: -30px; top: -20px; box-shadow: 2px 5px 12px #555555;" class="ui-corner-all ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix">Acesso ao Sistema</div>
			<form id="formLogin">
				<table style="color: #1C94C4; font-weight: bold;" >
					
					<tr>
						<td>Login</td>
						<td><input type="text" id="login" name="login"
							class="text ui-widget-content ui-corner-all ui-state-default">
						</td>
					</tr>
					<tr>
						<td>Senha</td>
						<td><input type="password" id="senha" name="senha"
							class="text ui-widget-content ui-corner-all ui-state-default">
						</td>
					</tr>
					<tr>
						<td></td>
						<td align="right"><button id="btnLogar"
								style="padding-left: 20px; padding-right: 20px;">OK</button></td>
					</tr>
				</table>
				<div align="left" id="msn"></div> 
			</form>
		</fieldset>
	</div>
</body>
</html>